package com.zx.cloud.controller.client;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.zx.cloud.Shift;
import com.zx.cloud.controller.StatusCode;
import com.zx.cloud.domain.ChannelSource;
import com.zx.cloud.domain.Client;
import com.zx.cloud.domain.ClientRisk;
import com.zx.cloud.domain.LoanOrder;
import com.zx.cloud.domain.RepayOrder;
import com.zx.cloud.model.response.ObjectDataResponse;
import com.zx.cloud.model.response.Response;
import com.zx.cloud.util.Page;

/**
 * 
 * @ClassName: LoanClientFallback
 * @Description: 
 * @author: likun
 * @date: 2017年11月1日 下午6:55:28
 */
@Component
public class LoanClientFallback implements LoanClient {
	
    private static final Logger LOGGER = LoggerFactory.getLogger(LoanClientFallback.class);
    private void didNotGetResponse() {
        LOGGER.error("service '{}' has become unreachable", ProviderClient.SERVICE_ID);
    }
	@Override
	public ObjectDataResponse<Page<LoanOrder>> getLoanOrderList(LoanOrder loanOrder) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	@Override
	public ObjectDataResponse<LoanOrder> getLoanOrderDetail(LoanOrder loanOrder) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	@Override
	public ObjectDataResponse<Page<LoanOrder>> getMyLoanOrderList(LoanOrder loanOrder) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	@Override
	public ObjectDataResponse<Integer> doLending(LoanOrder loanOrder) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return new ObjectDataResponse<Integer>(1);
	}
	
	@Override
	public ObjectDataResponse<Page<LoanOrder>> getLendingOrderList(LoanOrder loanOrder) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	@Override
	public ObjectDataResponse<Integer> checkLoanOrder(LoanOrder loanOrder) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return new ObjectDataResponse<Integer>(1);
	}
	@Override
	public ObjectDataResponse<Integer> createLoanOrder(LoanOrder loanOrder) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return new ObjectDataResponse<Integer>(1);
	}
	@Override
	public ObjectDataResponse<Page<RepayOrder>> getRepayOrderList(RepayOrder repayOrder) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	@Override
	public ObjectDataResponse<RepayOrder> getRepayOrderDetail(RepayOrder repayOrder) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	@Override
	public ObjectDataResponse<Integer> repayrRemark(RepayOrder repayOrder) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	@Override
	public ObjectDataResponse<Integer> repaySendSMS(RepayOrder repayOrder) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	@Override
	public  ObjectDataResponse<Page<RepayOrder>>getOverdueOrderList(RepayOrder repayOrder) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	@Override
	public ObjectDataResponse<Integer> handBuildOverdue() {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	@Override
	public ObjectDataResponse<Integer> handWithhold() {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	@Override
	public ObjectDataResponse<Map<String, Object>> getClientRiskInfo(
			ClientRisk clientRisk) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	@Override
	public  ObjectDataResponse<List<ChannelSource>> getChannelList(ChannelSource channelSource) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	@Override
	public ObjectDataResponse<Integer> batchLendingOrder(List<String> list) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	@Override
	public ObjectDataResponse<Integer> loanRemark(LoanOrder loanOrder) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	@Override
	public ObjectDataResponse<Integer> switchPayment(int type) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	@Override
	public ObjectDataResponse<String> getPaymentSwitch() {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
   
}
